import tables
let table = toTable {
  "AUG": "Methionine",
  "UUU", "UUC": "Phenylalanine",
  "UUA", "UUG": "Leucine",
  "UCU", "UCC", "UCA", "UCG": "Serine",
  "UAU", "UAC":"Tyrosine",
  "UGU", "UGC":"Cysteine",
  "UGG": "Tryptophan",
  "UAA", "UAG", "UGA":"STOP",
}

proc translate*(dna: string): seq[string] = 
  for i in 0 ..< dna.len div 3:
    var protein = table[dna[i * 3 ..< min(i * 3 + 3, dna.len)]]
    if protein == "STOP":
      return
    result.add protein